<template>
  <div>
    <ul class="todo-main">
      <transition-group name="list" tag="MyItem">
        <MyItem v-for="item in list" :key="item.id" :item="item"></MyItem>
      </transition-group>
    </ul>
  </div>

</template>

<script>
import MyItem from "@/components/MyItem";

export default {
  name: "MyList",
  components: {
    MyItem
  },
  props: ["list"]
}
</script>

<style scoped>
/*list*/
.todo-main {
  margin-left: 0px;
  border: 1px solid #ddd;
  border-radius: 2px;
  padding: 0px;
}

.todo-empty {
  height: 40px;
  line-height: 40px;
  border: 1px solid #ddd;
  border-radius: 2px;
  padding-left: 5px;
  margin-top: 10px;
}

.list-enter-active {
  transition: all 1s;
}

.list-leave-active {
  transition: all 0.3s;
}

.list-enter {
  /* 进入的初始状态和离开的最终状态 */
  opacity: 0;
  transform: translateX(50px);
}

.list-leave-to {
  /* 进入的初始状态和离开的最终状态 */
  opacity: 0;
  transform: translateX(50px);
}
</style>
